/*
 *  Copyright 2001-2004 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package ar.uba.fi.posgrado.economy.web.form.honorary;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts.action.ActionForm;
import org.apache.struts.util.LabelValueBean;

import ar.uba.fi.posgrado.economy.model.Honorary;

/**
 * Form para {@link Honorary}.<br>
 * 
 * @author nicolas.gonzalez
 * @see ActionForm
 */
@SuppressWarnings("serial")
public class HonoraryForm extends ActionForm {

    private Long id;
    
    private String validityFrom;
    private Double value;
    private String reason;
    private Long teacherId;

    private String teacherName;

    private String debtStatusSelected;
    private List<LabelValueBean> debtStatusOptions = new ArrayList<LabelValueBean>(); 
    
    private String courseSelected;
    private List<LabelValueBean> courseOptions = new ArrayList<LabelValueBean>();
    
    // Cantidad de honorarios a crear. Por defecto se crea uno solo
    private Integer amountToCreate = new Integer(1);
    
    private List<Honorary> honoraries = new ArrayList<Honorary>();
    
    // Indica si se tiene q hacer el clear para cuando se tengan q mostrar para cargar.
    private boolean clear = false;
    
    /**
     * Limpia el formulario para la creacion.<br>
     * Tiene en cuenta si clear esta en true o false para algunos campos
     */
    public void clearForNew() {
        if (this.clear) {
            this.id = null;
            this.validityFrom = "";
            this.value = null;
            this.reason = "";
            this.teacherId = null;
            this.teacherName = "";
            this.courseSelected = "";
            this.debtStatusSelected = "";
            this.amountToCreate = new Integer(1);
            
            this.clear = false; // Limpio este
        }
    }
    

    /**
     * @return the id
     */
    public Long getId() {
        return this.id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the validityFrom
     */
    public String getValidityFrom() {
        return this.validityFrom;
    }

    /**
     * @param validityFrom the validityFrom to set
     */
    public void setValidityFrom(String validityFrom) {
        this.validityFrom = validityFrom;
    }

    /**
     * @return the value
     */
    public Double getValue() {
        return this.value;
    }

    /**
     * @param value the value to set
     */
    public void setValue(Double value) {
        this.value = value;
    }

    /**
     * @return the reason
     */
    public String getReason() {
        return this.reason;
    }

    /**
     * @param reason the reason to set
     */
    public void setReason(String reason) {
        this.reason = reason;
    }

    /**
     * @return the teacherId
     */
    public Long getTeacherId() {
        return this.teacherId;
    }

    /**
     * @param teacherId the teacherId to set
     */
    public void setTeacherId(Long teacherId) {
        this.teacherId = teacherId;
    }

    /**
     * @return the teacherName
     */
    public String getTeacherName() {
        return this.teacherName;
    }

    /**
     * @param teacherName the teacherName to set
     */
    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    /**
     * @return the debtStatusSelected
     */
    public String getDebtStatusSelected() {
        return this.debtStatusSelected;
    }

    /**
     * @param debtStatusSelected the debtStatusSelected to set
     */
    public void setDebtStatusSelected(String debtStatusSelected) {
        this.debtStatusSelected = debtStatusSelected;
    }

    /**
     * @return the debtStatusOptions
     */
    public List<LabelValueBean> getDebtStatusOptions() {
        return this.debtStatusOptions;
    }

    /**
     * @param debtStatusOptions the debtStatusOptions to set
     */
    public void setDebtStatusOptions(List<LabelValueBean> debtStatusOptions) {
        this.debtStatusOptions = debtStatusOptions;
    }

    /**
     * @return the courseSelected
     */
    public String getCourseSelected() {
        return this.courseSelected;
    }

    /**
     * @param courseSelected the courseSelected to set
     */
    public void setCourseSelected(String courseSelected) {
        this.courseSelected = courseSelected;
    }

    /**
     * @return the courseOptions
     */
    public List<LabelValueBean> getCourseOptions() {
        return this.courseOptions;
    }

    /**
     * @param courseOptions the courseOptions to set
     */
    public void setCourseOptions(List<LabelValueBean> courseOptions) {
        this.courseOptions = courseOptions;
    }

    /**
     * @return the honoraries
     */
    public List<Honorary> getHonoraries() {
        return this.honoraries;
    }

    /**
     * @param honoraries the honoraries to set
     */
    public void setHonoraries(List<Honorary> honoraries) {
        this.honoraries = honoraries;
    }

    /**
     * @return the amountToCreate
     */
    public Integer getAmountToCreate() {
        return this.amountToCreate;
    }
    /**
     * @param amountToCreate the amountToCreate to set
     */
    public void setAmountToCreate(Integer amountToCreate) {
        this.amountToCreate = amountToCreate;
    }


    /**
     * @param clear the clear to set
     */
    public void setClear(boolean clear) {
        this.clear = clear;
    }
    
    
}
